package com.aaa.mbs.task;

import com.aaa.mbs.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @fileName:OrderScheduledTask
 * @description:
 * @author:zhz
 * @createTime:2020/12/11 11:42
 * @version:1.0.0
 */
//@EnableScheduling   //开启调度任务
//@Component  //交给spring管理
public class OrderScheduledTask {

    @Autowired
    private OrderService orderService;
    /**
     * 订单超时自动取消任务
     */
//    @Scheduled(cron = "*/5 * * * * *")
//    public void orderCanncelTask(){
//        System.out.println("每5秒执行一次。。。。。");
//        orderService.autoCanncelOrder();
//    }
}
